package com.content.management.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author xinghu
 * @version 1.0
 * @date 2020/3/12 3:05 下午
 */
@Configuration
public class WebAppConfigurer implements WebMvcConfigurer {

	@Resource
	ResponseResultInterceptor responseResultInterceptor;

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// 可添加多个，这里选择拦截所有请求地址，进入后判断是否有加注解即可
		registry.addInterceptor(responseResultInterceptor).addPathPatterns("/**");
	}
}
